home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows LSIsCurrency --->
-
- <HTML>
- <HEAD>
- <TITLE>LSIsCurrency Example</TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
- <BODY bgcolor="#FFFFD5">
-
- <H3>LSIsCurrency Example</H3>
-
-
- <CFIF IsDefined("form.locale")>
- <!--- if locale is defined, set locale to that entry --->
- <CFSET NewLocale = SetLocale("#form.locale#")>
-
- <P>Is the value "<CFOUTPUT>#form.myValue#</cFOUTPUT>"
- a proper currency value for <CFOUTPUT>#GetLocale()#</CFOUTPUT>?
-
- <P>Answer: <CFOUTPUT>#LSIsCurrency(form.myValue)#</CFOUTPUT>
- </CFIF>
-
- <P>
- <FORM ACTION="lsiscurrency.cfm" METHOD="POST">
-
- <P>Select a locale for which you would like to check
- a currency value:
-
- <!--- check the current locale for server --->
- <CFSET serverLocale = GetLocale()>
-
- <P><SELECT name="Locale">
- <!--- loop through a list of possible locales and
- display --->
- <CFLOOP LIST="#Server.Coldfusion.SupportedLocales#" INDEX="locale" DELIMITERS=",">
- <CFSET oldlocale = SetLocale("#locale#")>
- <CFOUTPUT><OPTION value="#locale#" <CFIF locale is ServerLocale>SELECTED</CFIF>>#Locale#</CFOUTPUT>
- </CFLOOP>
- </SELECT>
-
- <CFSET TheServerLocale = SetLocale(serverLocale)>
- <P>Enter a currency value
- <P><INPUT TYPE="Text" NAME="MyValue" VALUE="<CFOUTPUT>#LSCurrencyFormat(36.00, "Local")#</CFOUTPUT>">
- <P><INPUT TYPE="Submit" NAME="" VALUE="Is it a valid currency entry?">
-
- </FORM>
-
- </BODY>
-
- </HTML>
-